package edu.njucm.herbiv.dao;

import edu.njucm.herbiv.pojo.entity.Formula;
import jakarta.annotation.Nonnull;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

/**
 * @Author ZhouHang
 * @Date 24/4/23 023
 */
@Repository
public interface FormulaRepository extends JpaRepository<Formula, String> {
    @Nonnull Page<Formula> findAll(@Nonnull Pageable pageable);
    Page<Formula> findAllByIdLike(String id, Pageable pageable);
    Page<Formula> findAllByNameLike(String name, Pageable pageable);
    Page<Formula> findAllByPrescriptionCompositionLike(String composition, Pageable pageable);
    Page<Formula> findAllByTreatmentSymptomsLike(String symptom, Pageable pageable);
    Page<Formula> findAllBySourceDocumentLike(String source, Pageable pageable);
}
